package com.songlanyun.modules.publicbenefitmsg.model;

import com.songlanyun.common.drive.ValueObject;
import com.songlanyun.common.enums.DonationConstant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 捐赠消息
 *
 * @author EDY
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DonateMsg implements ValueObject, IPublicBenefitMsgBody {

    {
        welfareType = DonationConstant.WelfareType.DONATION;
    }

    /**
     * 操作类型
     */
    private DonationConstant.DonateMsgType modelType;

    /**
     * 捐赠ID
     */
    private Long modelId;

    /**
     * 公益积分
     */
    private BigDecimal points;

    /**
     * 公益类型
     * 0：捐款
     * 1：捐物
     * 2：捐积分
     */
    private DonationConstant.WelfareType welfareType;

    public void setModelType(Integer modelType) {
        this.modelType = DonationConstant.DonateMsgType.getByCode(modelType);
    }
}
